package com.hxn.wxshake.bean;

import com.hxn.wxshake.constant.ModuleCodeInterval;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @ClassName WebResult
 * @Description web返回的数据
 * @Author hxn
 * @Date 2019/8/6 15:04
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
public class WebResult {
    private int code;
    private String msg;
    private Object data;



    public static WebResult success(){
        return new WebResult(ModuleCodeInterval.SUCCESS,"成功",null);
    }

    public static WebResult success(Object data){
        return new WebResult(ModuleCodeInterval.SUCCESS,"成功",data);
    }

    public static WebResult fail(final int code,final String msg,final Object data){
        return new WebResult(code,msg,data);
    }

}
